Data tuple testing and routing for a streaming application

ABSTRACT

A tuple testing and routing operator in a streaming application routes data tuples to multiple parallel test operators that test in parallel the data tuples, receives feedback from the multiple parallel test operators regarding the results of testing the data tuples, routes a data tuple to a first operator when the data tuple passes the multiple parallel test operators according to a specified pass threshold, and optionally routes the data tuple to a second operator when the data tuple does not pass the multiple parallel test operators according to the specified pass threshold. The pass threshold allows testing to be done in a way that does not require all tests to be performed for all data tuples, thereby enhancing performance.

BACKGROUND

1. Technical Field

This disclosure generally relates to streaming applications, and morespecifically relates to the testing and routing of data tuples in astreaming application.

2. Background Art

Streaming applications are known in the art, and typically includemultiple operators coupled together in a flow graph that processstreaming data in near real-time. An operator typically takes instreaming data in the form of data tuples, operates on the data tuplesin some fashion, and outputs the processed data tuples to the nextoperator. Streaming applications are becoming more common due to thehigh performance that can be achieved from near real-time processing ofstreaming data.

Some streaming applications need to test all data tuples using one ormore test operators, and route the data tuples to different operatorsbased on the results of the test operators. When many tests need to beperformed, serializing the tests results in longer latency in processingthe data tuples. Placing the tests in parallel can improve performance,but still results in running all data tuples through all tests.

BRIEF SUMMARY

A tuple testing and routing operator in a streaming application routesdata tuples to multiple parallel test operators that test in parallelthe data tuples, receives feedback from the multiple parallel testoperators regarding the results of testing the data tuples, routes adata tuple to a first operator when the data tuple passes the multipleparallel test operators according to a specified pass threshold, andoptionally routes the data tuple to a second operator when the datatuple does not pass the multiple parallel test operators according tothe specified pass threshold. The pass threshold allows testing to bedone in a way that does not require all tests to be performed for alldata tuples, thereby enhancing performance.

The foregoing and other features and advantages will be apparent fromthe following more particular description, as illustrated in theaccompanying drawings.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWING(S)

The disclosure will be described in conjunction with the appendeddrawings, where like designations denote like elements, and:

FIG. 1 is a block diagram of a computer system that includes a tupletesting and routing operator that tests data tuples using multipleparallel operators and routes the data tuples to different operatorsdepending on the results of the tests according to a specified passthreshold;

FIG. 2 is a block diagram of a sample streaming application that testsdata tuples using multiple serial testing operators and outputs the datatuples to different operators depending on the results of the tests;

FIG. 3 is a block diagram of a streaming application that tests datatuples using multiple parallel testing operators and may output the datatuples to different operators depending on the results of the tests;

FIG. 4 is a block diagram of a tuple testing and routing operator in astreaming application that tests data tuples using multiple paralleltesting operators according to a specified pass threshold and outputsthe data tuples to different operators depending on the results of thetests without performing all tests on all data tuples;

FIG. 5 is a flow diagram of a method for setting up testing of datatuples using multiple parallel operators by a tuple testing and routingoperator according to a specified pass threshold;

FIG. 6 is a table showing specified parameters that govern the functionof the tuple testing and routing operator;

FIG. 7 is a table in which results of the testing by the multiple testoperators shown in FIG. 4 are compiled for eight data tuples in a batch;

FIG. 8 is a flow diagram of a method for the tuple testing and routingoperator to test data tuples using parallel test operators according toa specified pass threshold and for routing the data tuples according tothe results from the parallel test operators;

FIG. 9 is a partial flow diagram showing the testing of data tuples T1and T2 using the four parallel operators shown in FIG. 4;

FIG. 10 is a partial flow diagram showing the testing of data tuples T3and T4 using the four parallel operators shown in FIG. 4;

FIG. 11 is a table similar to the table in FIG. 7 after results oftesting data tuples T1, T2, T3 and T4 in FIGS. 9 and 10 have beencompiled;

FIG. 12 is a partial flow diagram showing the testing of data tuples T3and T4 using the four parallel operators shown in FIG. 4;

FIG. 13 is the table shown in FIG. 11 after the results of the testingin FIG. 12 have been compiled;

FIG. 14 is a table showing specified parameters that govern the functionof the tuple testing and routing operator;

FIG. 15 is a partial flow diagram showing the testing of data tuples T1,T2, T3 and T4 using the four parallel operators shown in FIG. 4;

FIG. 16 is a table similar to the table in FIG. 7 after results oftesting data tuples T1, T2, T3 and T4 in FIG. 15 have been compiled;

FIG. 17 is a partial flow diagram showing the testing of data tuples T5,T1, T2 and T3 using the four parallel operators shown in FIG. 4;

FIG. 18 is the table shown in FIG. 16 after the results of the testingin FIG. 17 have been compiled;

FIG. 19 is a partial flow diagram showing the testing of data tuples T3,T4, T5 and T2 using the four parallel operators shown in FIG. 4; and

FIG. 20 is the table shown in FIG. 18 after the results of the testingin FIG. 19 have been compiled.

DETAILED DESCRIPTION

The disclosure and claims herein are directed to a tuple testing androuting operator in a streaming application that routes data tuples tomultiple parallel test operators that test in parallel the data tuples,receives feedback from the multiple parallel test operators regardingthe results of testing the data tuples, routes a data tuple to a firstoperator when the data tuple passes the multiple parallel test operatorsaccording to a specified pass threshold, and optionally routes the datatuple to a second operator when the data tuple does not pass themultiple parallel test operators according to the specified passthreshold. The pass threshold allows testing to be done in a way thatdoes not require all tests to be performed for all data tuples, therebyenhancing performance.

Referring to FIG. 1, a computer system 100 is one suitableimplementation of a server computer system that includes a multipleconnection export operator as described in more detail below. Servercomputer system 100 is an IBM POWER8 computer system. However, thoseskilled in the art will appreciate that the disclosure herein appliesequally to any computer system, regardless of whether the computersystem is a complicated multi-user computing apparatus, a single userworkstation, a laptop computer system, a tablet computer, a phone, or anembedded control system. As shown in FIG. 1, computer system 100comprises one or more processors 110, a main memory 120, a mass storageinterface 130, a display interface 140, and a network interface 150.These system components are interconnected through the use of a systembus 160. Mass storage interface 130 is used to connect mass storagedevices, such as local mass storage device 155, to computer system 100.One specific type of local mass storage device 155 is a readable andwritable CD-RW drive, which may store data to and read data from a CD-RW195. Another suitable type of local mass storage device 155 is a cardreader that receives a removable memory card, such as an SD card, andperforms reads and writes to the removable memory. Yet another suitabletype of local mass storage device 155 is a thumb drive.

Main memory 120 preferably contains data 121, an operating system 122,and a streams manager 123. Data 121 represents any data that serves asinput to or output from any program in computer system 100. Operatingsystem 122 is a multitasking operating system, such as AIX or LINUX. Thestreams manager 123 is software that provides a run-time environmentthat executes a streaming application 124. The streaming application 124comprises a flow graph that includes processing elements that includeoperators that process data tuples. The streaming application 124includes a tuple testing and routing operator 125 that routes datatuples to multiple parallel test operators that test in parallel datatuples, receives feedback from the multiple parallel test operatorsregarding the results of testing the data tuples, routes a data tuple toa first operator when the data tuple passes the multiple parallel testoperators according to a specified pass threshold 126, and routes thedata tuple to a second operator when the data tuple does not pass themultiple parallel test operators according to the specified passthreshold 126, as discussed in more detail below.

Computer system 100 utilizes well known virtual addressing mechanismsthat allow the programs of computer system 100 to behave as if they onlyhave access to a large, contiguous address space instead of access tomultiple, smaller storage entities such as main memory 120 and localmass storage device 155. Therefore, while data 121, operating system122, and streams manager 123 are shown to reside in main memory 120,those skilled in the art will recognize that these items are notnecessarily all completely contained in main memory 120 at the sametime. It should also be noted that the term “memory” is used hereingenerically to refer to the entire virtual memory of computer system100, and may include the virtual memory of other computer systemscoupled to computer system 100.

Processor 110 may be constructed from one or more microprocessors and/orintegrated circuits. Processor 110 executes program instructions storedin main memory 120. Main memory 120 stores programs and data thatprocessor 110 may access. When computer system 100 starts up, processor110 initially executes the program instructions that make up operatingsystem 122. Processor 110 also executes the streams manager 123, whichexecutes the streaming application 124, which includes the multipleconnection export operator 126.

Although computer system 100 is shown to contain only a single processorand a single system bus, those skilled in the art will appreciate thattuple testing and routing operator in a streaming application asdescribed herein may be practiced using a computer system that hasmultiple processors and/or multiple buses. In addition, the interfacesthat are used preferably each include separate, fully programmedmicroprocessors that are used to off-load compute-intensive processingfrom processor 110. However, those skilled in the art will appreciatethat these functions may be performed using I/O adapters as well.

Display interface 140 is used to directly connect one or more displays165 to computer system 100. These displays 165, which may benon-intelligent (i.e., dumb) terminals or fully programmableworkstations, are used to provide system administrators and users theability to communicate with computer system 100. Note, however, thatwhile display interface 140 is provided to support communication withone or more displays 165, computer system 100 does not necessarilyrequire a display 165, because all needed interaction with users andother processes may occur via network interface 150.

Network interface 150 is used to connect computer system 100 to othercomputer systems or workstations 175 via network 170. Network interface150 broadly represents any suitable way to interconnect electronicdevices, regardless of whether the network 170 comprises present-dayanalog and/or digital techniques or via some networking mechanism of thefuture. Network interface 150 preferably includes a combination ofhardware and software that allows communicating on the network 170.Software in the network interface 150 preferably includes acommunication manager that manages communication with other computersystems 175 via network 170 using a suitable network protocol. Manydifferent network protocols can be used to implement a network. Theseprotocols are specialized computer programs that allow computers tocommunicate across a network. TCP/IP (Transmission ControlProtocol/Internet Protocol) is an example of a suitable network protocolthat may be used by the communication manager within the networkinterface 150. In one suitable implementation, the network interface 150is a physical Ethernet adapter.

The present invention may be a system, a method, and/or a computerprogram product at any possible technical detail level of integration.The computer program product may include a computer readable storagemedium (or media) having computer readable program instructions thereonfor causing a processor to carry out aspects of the present invention.

The computer readable storage medium can be a tangible device that canretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein can bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local area network, awide area network and/or a wireless network. The network may comprisecopper transmission cables, optical transmission fibers, wirelesstransmission, routers, firewalls, switches, gateway computers and/oredge servers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present invention may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, configuration data for integrated circuitry, oreither source code or object code written in any combination of one ormore programming languages, including an object oriented programminglanguage such as Smalltalk, C++, or the like, and procedural programminglanguages, such as the “C” programming language or similar programminglanguages. The computer readable program instructions may executeentirely on the user's computer, partly on the user's computer, as astand-alone software package, partly on the user's computer and partlyon a remote computer or entirely on the remote computer or server. Inthe latter scenario, the remote computer may be connected to the user'scomputer through any type of network, including a local area network(LAN) or a wide area network (WAN), or the connection may be made to anexternal computer (for example, through the Internet using an InternetService Provider). In some embodiments, electronic circuitry including,for example, programmable logic circuitry, field-programmable gatearrays (FPGA), or programmable logic arrays (PLA) may execute thecomputer readable program instructions by utilizing state information ofthe computer readable program instructions to personalize the electroniccircuitry, in order to perform aspects of the present invention.

Aspects of the present invention are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems), and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a general purpose computer, special purpose computer, orother programmable data processing apparatus to produce a machine, suchthat the instructions, which execute via the processor of the computeror other programmable data processing apparatus, create means forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks. These computer readable program instructionsmay also be stored in a computer readable storage medium that can directa computer, a programmable data processing apparatus, and/or otherdevices to function in a particular manner, such that the computerreadable storage medium having instructions stored therein comprises anarticle of manufacture including instructions which implement aspects ofthe function/act specified in the flowchart and/or block diagram blockor blocks.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable apparatus or other device to produce a computerimplemented process, such that the instructions which execute on thecomputer, other programmable apparatus, or other device implement thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods, and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof instructions, which comprises one or more executable instructions forimplementing the specified logical function(s). In some alternativeimplementations, the functions noted in the blocks may occur out of theorder noted in the Figures. For example, two blocks shown in successionmay, in fact, be executed substantially concurrently, or the blocks maysometimes be executed in the reverse order, depending upon thefunctionality involved. It will also be noted that each block of theblock diagrams and/or flowchart illustration, and combinations of blocksin the block diagrams and/or flowchart illustration, can be implementedby special purpose hardware-based systems that perform the specifiedfunctions or acts or carry out combinations of special purpose hardwareand computer instructions.

Referring to FIG. 2, an extremely simplified streaming application 200is shown. The streaming application 200 includes six operators A, B, C,D, E and F, and two paths labeled PASS and FAIL that lead to one or moreother operators not shown in FIG. 2. Operator A produces data tuplesthat are sent to operator B. Operator B performs a test on the datatuples and passes them on to operator C. Operator C performs a test onthe data tuples and passes them on to operator D. Operator D performs atest on the data tuples and passes them on to operator E. Operator Eperforms a test on the data tuples and passes them on to operator F.Operator F then reviews the results of the tests performed in operatorsB, C, D and E, and determines whether a data tuples passes all of thesetests. If a data tuple passes all of the tests in operators B, C, D andE, the data tuple is routed by operator F on a path labeled PASS in FIG.2 to some downstream operator for further processing. If a data tupledoes not pass all of the tests in operators B, C, D and E, the tuple isrouted on a path labeled FAIL in FIG. 2 to some downstream operator forfurther processing.

The serialization of the tests in operators B, C, D and E as shown inFIG. 2 can result in considerable time delay before operator F routes adata tuple to the next operator on the PASS path or the next operator onthe FAIL path. It would improve performance if these tests could beperformed in parallel. Referring to FIG. 3, a streaming application 300is shown that includes the same originating operator A and the sameoperator F that determines the results of the test in operators B, C, Dand E, and routes data tuples to an operator on the PASS path or to anoperator on the FAIL path depending on the results of the tests inoperators B, C, D and E. The difference in application 300 in FIG. 3when compared to application 200 in FIG. 2 is the testing in operatorsB, C, D and E is performed in parallel. This means a data tuple isrouted by operator A to all four operators B, C, D and E, which thentest the data tuple and provide the test results to operator F. When adata tuple passes all four tests in operators B, C, D and E, operator Fforwards the data tuple to a downstream operator on the PASS path. Whena data tuple does not pass all four tests in operators B, C, D and E,operator F forwards the data tuple to a downstream operator on the FAILpath. While the streaming application 300 in FIG. 3 has improvedperformance when compared to application 200 in FIG. 2 due to performingthe testing in operators B, C, D and E in parallel, both applications200 and 300 perform all tests in operators B, C, D and E on each andevery data tuple.

There may be some situations where multiple tests are performed on adata tuple, but a data tuple need not pass all of the tests to pass. Forexample, let's assume data tuples from a video stream are beingprocessed, and if a data tuple passes half or more of the tests beingperformed, the data tuple is deemed to have passed and is passed to adownstream operator on a PASS path, and if a data tuple does not passhalf or more of the tests being performed, the data tuple is deemed tohave failed and may be discarded or passed to a downstream operator on aFAIL path. While this functionality could be incorporated into operatorF in FIG. 3, the application 300 would still require testing each datatuple using all operators B, C, D and E.

The disclosure and claims herein provide a tuple testing and routingoperator that operates according to a specified pass threshold, and doesnot have to perform all tests on all data tuples. Referring to FIG. 4, atuple testing and routing operator 410 that operates according to aspecified pass threshold 420 is one suitable example for tuple testingand routing operator 125 in FIG. 1 that operators according to thespecified pass threshold 126. Operator A 410 routes data tuples to testoperators B, C, D and E, which perform their testing in parallel. Weassume each operator B, C, D and E returns a Boolean value thatindicates whether the data tuple that was processed passed or failed thetest. The tuple testing and routing operator 410 routes data tuples tomultiple parallel test operators B, C, D and E that test in parallel thedata tuples. Each test operator includes a feedback signal to indicatethe results of the test. Thus, operator B includes a feedback signal 420to the tuple testing and routing operator 410; operator C includes afeedback signal 430 to the tuple testing and routing operator 410;operator D includes a feedback signal 440 to the tuple testing androuting operator 410; and operator E includes a feedback signal 450 tothe tuple testing and routing operator 410. The feedback signal from atesting operator to the tuple testing and routing operator not onlynotifies of the test results, but additionally indicates the operatorhas completed the testing and is ready for the next data tuple. Thetuple testing and routing operator 410 then compares the test resultsfor a data tuple to the pass threshold 420, and in many cases thedetermination of whether a data tuple passes or fails can be madewithout all of the testing operators B, C, D and E testing the datatuple. When a data tuple passes the required number of tests accordingto the pass threshold 420, the data tuple is passed to a downstreamoperator F along a PASS path. When a data tuple does not pass therequired number of tests according to the pass threshold 420, the tupletesting and routing operator 410 may discard the data tuple, or mayoptionally pass the data tuple to a downstream operator G along a FAILpath, as shown in FIG. 4. In this example, the F operator could bedeemed a “pass operator” and the G operator could be deemed a “failoperator.” Note the PASS and FAIL paths could each includes multipleoperators that are not shown in FIG. 4. By providing testing usingmultiple parallel test operators, and by specifying a pass threshold,the tuple testing and routing operator can in many cases determine whena data tuple passes or fails without all of the parallel test operatorsprocessing the data tuple, thereby enhancing performance.

The tuple testing and routing operator functions according to definedparameters. FIG. 5 shows a flow diagram of a method 500 for definingparameters for the tuple testing and routing operator. A suitable numberof parallel test operators are defined (step 510). For the simpleexample in FIG. 4, a determination is made that four parallel testoperators are needed, and these four operators B, C, D and E as shown inFIG. 4 are defined. Next, a batch size for data tuples is defined (step520). A routing method for the data tuples in a batch is then defined(step 530). The pass threshold is set (step 540). Once method 500 hassetup the parameters, the tuple testing and routing operator can performits functions.

Referring to FIG. 6, a table 600 shows the parameters that could applyto the tuple testing and routing operator 410 shown in FIG. 4. For thespecific example in FIG. 6, the number of parallel test operators isfour, the batch size is eight data tuples, the routing method is onetuple per two operators, and the pass threshold is 50%. The passthreshold, as shown in FIG. 6, specifies a percentage that must be metor exceeded for a data tuple to pass the multiple parallel testoperators. We assume the parameters in FIG. 6 are defined for the tupletesting and routing operator 410 in FIG. 4. As the tuple testing androuting operator 410 tests data tuples using the parallel testoperators, the results are compiled into a table such as table 700 shownin FIG. 7.

Referring to FIG. 8, a method 800 represents functions performed by thetuple testing and routing operator, such as 125 in FIGS. 1 and 410 inFIG. 4. Data tuples from a batch are routed to the multiple paralleltest operators according to the specified routing method (step 810). Thetest results are compiled for each data tuple processed (step 820), suchas using a table like table 700 in FIG. 7. This is preferably done bylogging the test results received on the feedback paths from themultiple parallel testing operators. When the compiled test results fora data tuple meet the specified pass threshold (step 830=YES), the datatuple is routed to the PASS path (step 840). When the compiled testresults for a data tuple do not meet the pass threshold (step 830=NO),when more tests are needed for the data tuple in order to determinewhether the pass threshold is met or not (step 850=YES), method 800loops back to step 810 and continues. When no more tests are needed forthe data tuple (step 850=NO), the data tuple is routed to the fail path(step 860). When there are more data tuples in the batch (step 870=YES),method 800 loops back to step 810 until there are no more data tuples inthe batch (step 870=NO), at which time method 800 is done.

Two simple examples are now presented to illustrate the function of thetuple testing and routing operator 410 in the configuration shown inFIG. 4. We assume the parameters in table 600 in FIG. 6 are defined forthe tuple testing and routing operator 410. FIGS. 9 and 10 show aportion of the flow diagram in FIG. 4 showing the multiple paralleltesting operators B, C, D and E, and the results that are returned onthe feedback path when testing specified data tuples. We assume a table700 is created that specifies the eight data tuples T1-T8 in the batch,along with columns for each of the parallel testing operators toindicate test results of the data tuples they process. Because therouting method in FIG. 6 is one per two operators, this means each datatuple will be sent to two of the four testing operators at a time. Usingthis routing method, the tuple testing and routing operator 410 sendsdata tuple T1 to operators B and C, and sends data tuple T2 to operatorsD and E, as shown in FIG. 9. We assume for this example all four ofthese tests passed, as shown in FIG. 9. As a result, the two passes forT1 for operators B and C are logged in the table, and the two passes forT2 for operators D and E are logged in the table, as shown in table 1100in FIG. 11. With a pass threshold of 50%, this means both data tuples T1and T2 pass according to the pass threshold without having to performthe tests of these data tuples by the other parallel test operators.Table 1100 shown in FIG. 11 includes an “X” in the columns that indicatewhich tests did not need to be performed. Because the tuple testing androuting operator 410 detects data tuples T1 and T2 have passed withoutperforming half of the tests, both data tuples T1 and T2 are routed onthe PASS operator F shown in FIG. 4.

Referring to FIG. 10, the tuple testing and routing operator 410 thenroutes data tuple T3 to operators B and C, and routes data tuple T4 tooperators D and E, with the results shown in FIG. 10. These results arelogged in table 1100 in FIG. 11. Note the test results for T3 and T4shown in FIG. 11 do not yet give enough information to know whether ornot data tuples T3 and T4 have passed or not. If data tuple T3 passesone or both of the tests in operators D and E, data tuple T3 will pass.If data tuple T3 fails both of the tests in operators D and E, datatuple T3 will fail. If data tuple T4 passes both of the tests inoperators B and C, data tuple T4 will pass. If data tuple T4 fails oneor both of the tests in operators B and C, data tuple T4 will fail.Because the results for data tuples T3 and T4 shown in FIG. 11 do notallow determining a pass or fail according to the 50% pass threshold,more testing of T3 and T4 are needed, as shown in step 850=YES in FIG.8.

FIG. 12 shows the tuple testing and routing operator 410 routes datatuple T4 to operators B and C, and routes data tuple T3 to operators Dand E, with the results as shown in FIG. 12. These results are compiledinto the results table, as shown in table 1300 in FIG. 13. We see fromthe test results in table 1300 that data tuple T3 passes because it hasmet the 50% pass threshold, while data tuple T4 has failed because itdid not meet the 50% pass threshold. The tuple testing and routingoperator 410 will thus route data tuple T3 to the PASS operator F, andwill discard data tuple T4 or route data tuple T4 to the FAIL operatorG. The tuple testing and routing operator will then continue processingdata tuples T5-T8 in similar fashion, performing only those tests neededto come to a conclusion regarding whether a data tuple satisfies thepass threshold, which in some cases means less than all of the tests areperformed for a particular data tuple, and sending the data tuples tothe PASS operator F or the FAIL operator G (or discard a failed datatuple) once a determination can be made of whether a data tuplesatisfies the pass threshold, even when less than all of the tests havebeen performed for each data tuple.

There is a timing issue that is not represented well in FIG. 13. Let'sassume, for example, that operator D takes a very long time to performits test, while operator E can perform its test in a fraction of thetime it takes operator D to perform its test. This means operator E willfeed back its test results long before operator D. As shown by the testresults in FIG. 12 and compiled in table 1300 in FIG. 13, once the tupletesting and routing operator 410 receives a pass indication fromoperator E for data tuple T3, data tuple T3 satisfies the pass thresholdof 50% regardless of the result of the test in operator D. This allowsthe tuple testing and routing operator 410 to direct operator D to abortits processing of data tuple T3, and to send data tuple T3 to the PASSoperator F. The tuple testing and routing operator uses the informationcompiled in the results table to determine when a data tuple does ordoes not satisfy the pass threshold. When the answer is clear from thetesting already performed, the data tuple can be routed to theappropriate PASS or FAIL operators, or may be discarded if the datatuple failed, and the tuple testing and routing operator 410 need notprocess the data tuple any further. When the answer is not clear fromthe testing already performed, more testing is needed, and the tupletesting and routing operator sends in an asynchronous manner data tuplesto the multiple parallel test operators. The tuple testing and routingoperator can thus determine from the compiled results when a data tuplessatisfies the pass criteria, or cannot satisfy the pass criteria evenwith additional processing, and can send the data tuple on to theappropriate PASS or FAIL operator, or may discard a failed data tuple,without requiring any additional testing of the data tuple. The tupletesting and routing operator thus provides a way to reduce the number oftests performed on data tuples to the minimum needed to make adetermination of whether a data tuple satisfies the pass threshold ornot. The result is that some of the data tuples are not processed bysome of the multiple parallel test operators, which improves systemperformance when compared to an application such as 300 in FIG. 3 thatrequires each data tuple to be processed by each parallel test operator.Due to the differences in time for each of the parallel testingoperators to perform their tests, the tuple testing and routing operatorcan route data tuples in an asynchronous matter to each of the paralleltesting operators without regard to the processing state of the otherparallel testing operators.

A second example uses the same parameters as shown in table 600 in FIG.6, with the exception that the routing method has been changed from onedata tuple per two operators to one data tuple per operator, as shown intable 1400 in FIG. 14. Using the parameters in table 1400 in the tupletesting and routing operator 410 in FIG. 4, the first four data tuplesT1, T2, T3 and T4 are routed to the four parallel test operator B, C, Dand E, as shown in FIG. 15. The results are shown in FIG. 15 and arecompiled in table 1600 in FIG. 16. Note that a single test for each datatuple as shown in table 1600 is insufficient to determine whether thedata tuple passes the specified 50% pass threshold, so processing ofthese four data tuples must continue. We assume the tuple testing androuting operator 410 then routes data tuple T5 to operator B, routesdata tuple T1 to operator C, routes data tuple T2 to operator D, androutes data tuple T3 to operator E, as shown in FIG. 17, with theresults as shown in FIG. 17 and as compiled in table 1800 in FIG. 18.Because data tuple T1 passed operators B and C, further testing withoperators D and E are not needed, as indicated by the “X” in columns Dand E for data tuple T1 in table 1800 in FIG. 18. This means the tupletesting and routing operator 410 can send data tuple T1 to the PASSoperator F without routing data tuple T1 to parallel testing operators Dand E. For the other data tuples T2, T3, T4 and T5 that have testresults as shown in FIG. 18, no determination can be made regardingwhether these data tuples satisfy the 50% pass threshold, so moretesting is needed for each of these data tuples.

Next we assume the tuple testing and routing operator 410 sends datatuple T3 to operator B, send data tuple T4 to operator C, sends datatuple T5 to operator D, and sends data tuple T2 to operator E, as shownin FIG. 19, with the results as shown in FIG. 19 and compiled in table2000 in FIG. 20. With the fail from operator E for data tuple T2, thetuple testing and routing operator 410 determines data tuple T2 does notsatisfy the 50% pass threshold without needing to route data tuple T2 tooperator B. Similarly, with the pass from operator B for T3, the tupletesting and routing operator 410 determines data tuple T3 satisfies the50% pass threshold without needing to route data tuple T3 to operator C.Similarly, with the pass from operator C for data tuple T4, the tupletesting and routing operator 410 determines data tuple T4 satisfies the50% pass threshold without needing to route data tuple T4 to operators Bor D. With the information in table 2000, the tuple testing and routingoperator 410 cannot make a determination regarding whether or not datatuple T5 meets the 50% pass criteria or not, so further testing isneeded for data tuple T5. The routing of data tuples to the paralleltest operators will continue for the remaining data tuples T5, T6, T7and T8 in similar fashion to that described in detail above.

The Xs in FIG. 20 indicate the tests that did not have to be performed.These saved tests represent time that did not have to be spent testingtuples, and therefore represent a performance improvement for a systemthat includes the tuple testing and routing operator.

A tuple testing and routing operator in a streaming application routesdata tuples to multiple parallel test operators that test in parallelthe data tuples, receives feedback from the multiple parallel testoperators regarding the results of testing the data tuples, routes adata tuple to a first operator when the data tuple passes the multipleparallel test operators according to a specified pass threshold, andoptionally routes the data tuple to a second operator when the datatuple does not pass the multiple parallel test operators according tothe specified pass threshold. The pass threshold allows testing to bedone in a way that does not require all tests to be performed for alldata tuples, thereby enhancing performance.

One skilled in the art will appreciate that many variations are possiblewithin the scope of the claims. Thus, while the disclosure isparticularly shown and described above, it will be understood by thoseskilled in the art that these and other changes in form and details maybe made therein without departing from the spirit and scope of theclaims.

1. An apparatus comprising: at least one processor; a memory coupled tothe at least one processor; and a streaming application residing in thememory and executed by the at least one processor, the streamingapplication comprising a flow graph that includes a plurality ofoperators that process a plurality of data tuples, wherein the pluralityof operators comprises: a plurality of parallel test operators that testin parallel the plurality of data tuples; and a tuple testing androuting operator that routes the plurality of data tuples to theplurality of parallel test operators, receives feedback from theplurality of parallel test operators regarding the results of testingthe plurality of data tuples, and routes a first selected data tuplefrom the plurality of data tuples to a first operator when the firstselected data tuple passes the plurality of parallel test operatorsaccording to a specified pass threshold.
 2. The apparatus of claim 1wherein the tuple testing and routing operator routes a second selecteddata tuple from the plurality of data tuples to a second operator whenthe second selected data tuple does not pass the plurality of paralleltest operators according to the specified pass threshold.
 3. Theapparatus of claim 2 wherein the first operator comprises a passoperator and the second operator comprises a fail operator, wherein thetuple testing and routing operator routes the plurality of data tuplesto the pass operator and the fail operator without processing each ofthe plurality of data tuples with all of the plurality of parallel testoperators.
 4. The apparatus of claim 1 wherein the streaming applicationis executed under control of a streams manager and is configured by thestreams manager according to a specified routing method that determinesa number of the plurality of parallel test operators that operate inparallel on each of the plurality of data tuples.
 5. The apparatus ofclaim 1 wherein the pass threshold specifies a percentage that must bemet or exceeded for each of the plurality of data tuples to pass theplurality of parallel test operators.
 6. The apparatus of claim 1wherein the tuple testing and routing operator routes the plurality ofdata tuples to the plurality of parallel test operators asynchronouslyas each of the plurality of parallel test operators becomes availablebased on the feedback according to which of the plurality of data tuplesneed to be processed by the plurality of parallel test operators.
 7. Theapparatus of claim 1 wherein the tuple testing and routing operatorcompiles results of testing the plurality of data tuples by theplurality of parallel test operators in a table to determine when eachof the plurality of data tuples should be routed to the first operatoror the second operator according to the specified pass threshold.
 8. Theapparatus of claim 7 wherein the tuple testing and routing operatordetermines from the compiled results in the table and from the specifiedpass threshold when a selected data tuple needs more tests by theplurality of parallel test operators, and routes the selected data tupleto at least one of the plurality of parallel test operators when theselected data tuple needs more tests.
 9. The apparatus of claim 1wherein the tuple testing and routing operator causes at least one ofthe plurality of parallel test operators to abort processing the firstselected data tuple when the first selected data tuple passes thespecified pass threshold.
 10. A computer-implemented method executed byat least one processor for executing streaming applications, the methodcomprising: providing a streaming application comprising a first flowgraph that includes a plurality of operators that process a plurality ofdata tuples, wherein the plurality of operators comprises: a pluralityof parallel test operators that test in parallel the plurality of datatuples; and a tuple testing and routing operator that routes theplurality of data tuples to the plurality of parallel test operators,receives feedback from the plurality of parallel test operatorsregarding the results of testing the plurality of data tuples, androutes a first selected data tuple from the plurality of data tuples toa first operator when the first selected data tuple passes the pluralityof parallel test operators according to a specified pass threshold;defining at least one parameter that determines function of the tupletesting and routing operator; and executing the streaming application toprocess the plurality of data tuples according to the defined at leastone parameter.
 11. The method of claim 10 further comprising routing asecond selected data tuple from the plurality of data tuples to a secondoperator when the second selected data tuple does not pass the pluralityof parallel test operators according to the specified pass threshold.12. The method of claim 11 wherein the first operator comprises a passoperator and the second operator comprises a fail operator, wherein thetuple testing and routing operator routes the plurality of data tuplesto the pass operator and the fail operator without processing each ofthe plurality of data tuples with all of the plurality of parallel testoperators.
 13. The method of claim 10 further comprising executing thestreaming application under control of a streams manager and configuringthe streaming application by the streams manager according to aspecified routing method that determines a number of the plurality ofparallel test operators that operate in parallel on each of theplurality of data tuples.
 14. The method of claim 10 wherein the passthreshold specifies a percentage that must be met or exceeded for eachof the plurality of data tuples to pass the plurality of parallel testoperators.
 15. The method of claim 10 wherein the tuple testing androuting operator routes the plurality of data tuples to the plurality ofparallel test operators asynchronously as each of the plurality ofparallel test operators becomes available based on the feedbackaccording to which of the plurality of data tuples need to be processedby the plurality of parallel test operators.
 16. The method of claim 10wherein the tuple testing and routing operator compiles results oftesting the plurality of data tuples by the plurality of parallel testoperators in a table to determine when each of the plurality of datatuples should be routed to the first operator or the second operatoraccording to the specified pass threshold.
 17. The method of claim 16wherein the tuple testing and routing operator determines from thecompiled results in the table and from the specified pass threshold whena selected data tuple needs more tests by the plurality of parallel testoperators, and routes the selected data tuple to at least one of theplurality of parallel test operators when the selected data tuple needsmore tests.
 18. The method of claim 10 wherein the tuple testing androuting operator causes at least one of the plurality of parallel testoperators to abort processing the first selected data tuple when thefirst selected data tuple passes the specified pass threshold.
 19. Anapparatus comprising: at least one processor; a memory coupled to the atleast one processor; a streams manager residing in the memory andexecuted by the at least one processor, wherein the streams managerdefines a routing method for processing a plurality of data tuples and apass threshold that specifies a percentage that must be met or exceededfor each of the plurality of data tuples to pass, wherein the streamsmanager executes a streaming application residing in the memory, thestreaming application comprising a flow graph that includes a pluralityof operators that process a plurality of data tuples, wherein theplurality of operators comprises: a plurality of parallel test operatorsthat test in parallel the plurality of data tuples; and a tuple testingand routing operator that routes the plurality of data tuples to theplurality of parallel test operators asynchronously as each of theplurality of parallel test operators becomes available according to therouting method and the pass threshold, receives feedback from theplurality of parallel test operators regarding the results of testingthe plurality of data tuples, compiles results of testing the pluralityof data tuples by the plurality of parallel test operators in a table,routes a first selected data tuple from the plurality of data tuples toa pass operator when the first selected data tuple passes the pluralityof parallel test operators according to the pass threshold, and routes asecond selected data tuple from the plurality of data tuples to a failoperator when the second selected data tuple does not pass the pluralityof parallel test operators according to the pass threshold, wherein thetuple testing and routing operator routes the plurality of data tuplesto the pass operator and the fail operator without processing each ofthe plurality of data tuples with all of the plurality of parallel testoperators, wherein the tuple testing and routing operator causes atleast one of the plurality of parallel test operators to abortprocessing the first selected data tuple when the first selected datatuple passes the specified pass threshold; wherein the routing methoddetermines a number of the plurality of parallel test operators thatoperate in parallel on each of the plurality of data tuples.
 20. Theapparatus of claim 19 wherein the tuple testing and routing operatordetermines from the compiled results in the table and from the passthreshold when a selected data tuple needs more tests by the pluralityof parallel test operators, and routes the selected data tuple to atleast one of the plurality of parallel test operators when the selecteddata tuple needs more tests.